This invention relates to the field of computer graphics, and more particularly, this invention relates to a method and system for texture mapping data in computer graphics applications.
Most computer graphic systems use primitive data to present an object or model on a display screen. These primitive data include basic geometric components, such as points, lines, triangles, quadrilaterals, triangle strips and polygons. Primitive data are also used by a computer for defining three-dimensional objects, and can include various x, y, z and w coordinates of the three-dimensional objects. In more advanced graphics application programs, the primitive data includes texture mapping data. Graphics rendering hardware interpolates this type of primitive data and permits objects to be displayed with improved surface detail.
In a texture mapping system used as part of a graphics application package, a source image, i.e., a texture, is mapped onto the surface of a three-dimensional object, such as a building, and then projected into a two-dimensional graphics display screen, such as the normal cathode ray tube of a personal computer or workstation. The point elements (texels) of a texture are applied to the point elements or pixels of the object to be mapped. An application programming interface (API) receives commands from a user through the graphics application program and provides the primitive data to various graphics hardware devices, such as a rasterizer, frame buffer and texture mapping hardware. The rasterizer and texture mapping hardware accept this rendering data and generate final screen coordinates and color data for each pixel in each primitive.
When creating three-dimensional urban models from imagery, such as a geographic location containing many buildings, the models contain polygons that define the three-dimensional shapes of buildings and terrain. In this type of application, associated raster imagery is applied to the polygonal surfaces for added realism and detail. This process is also referred to as xe2x80x9ctexture mapping.xe2x80x9d The raster image data is applied to a polygonal model as part of the image generation or rendering process.
Some three-dimensional urban models have many buildings that are much too large to be rendered at interactive frame rates on most computer graphic systems. During the process of texture mapping polygons of a three-dimensional urban model, bottlenecks are usually encountered on the current generation of graphics hardware architectures, which read raster data either from the main system RAM (unified memory architecture) or from a dedicated high-speed texture cache (texture cache architecture). Thus, the overall process is inadequate in some instances. Even if a scene can be loaded, the systems cannot interactively manipulate a fully textured urban model.
The present invention is advantageous and provides a method for creating three-dimensional models with non-monotonic geometries (true 3D), such as a terrain model with buildings, that can be viewed efficiently in a texture mapping system. The system of the present invention extends the technology used for terrain texturing to building texturing by making a building clip texture that is spatially coherent. It is possible to construct a single image of a building from the many images that are required to paint all the sides. Building images are fit into a composite image of minimum dimension, including rotations and intelligent arrangements. Any associated building vertex texture coordinates can be scaled and translated to match a new composite image. The building images can be arranged in a large xe2x80x9cclip mapxe2x80x9d image, preserving the horizontal relationships of the buildings. If the horizontal relationships cannot be accurately preserved, a xe2x80x9cclip gridxe2x80x9d middle layer is constructed, which is used by the display software to accurately determine the clip map center.
At the highest level, the system creates a packed rectangle of textures for each of a plurality of three-dimensional objects corresponding to buildings modeled at a geographic site and then spatially arranges the packed rectangle of textures in a correct position within a site model clip map image.
In one aspect of the present invention, the method comprises the step of forming a single rectangular, composite building texture map for each of a plurality of three-dimensional objects corresponding to buildings to be modeled of a geographic site. Individual images are rotated to reduce the area of pixels included within the composite building texture map. Image sizes are processed by area and image length and sorted by area and image length before being packed into a composite building texture map. Each composite building texture map is placed in a spatially corrected position within a site model clip map image. That image is expanded until no overlap remains. The expansion can occur from top right to bottom left or other similar means as selected by those skilled in the art. A location of a clip center can be determined with respect to a particular x,y location for the site model clip map image by looking up values within a clip map clip grid look-up table. This table can be built by interrogating the vertices of all building polygon faces for corresponding texture coordinates and inserting each texture coordinate into the look-up table based on the corresponding polygon face vertex coordinates.
The method further comprises collecting images of each of the plurality of three-dimensional objects from different viewpoints and packing the images into a single rectangle, forming a composite building texture map for an object.
A system for creating three-dimensional models in a texture mapping system is applicable for creating three-dimensional urban models and includes a computer having a graphics application program and an application programming interface. A single rectangular, composite building texture map has each of a plurality of three-dimensional objects corresponding to individual buildings and has a reduced area of pixels within each composite building texture map as caused by rotating the individual images. A site model clip map image contains each composite building texture map in a spatially correct position, which has been expanded such that no overlap remains. Additionally, a clip map clip grid look-up table can be used for determining a location of a clip center with respect to a particular x,y location for the site model clip map image.